package com.lam.framework.async.model;

import java.util.concurrent.Callable;

public class CallableTask<T> extends AbstractRunTask<Callable<T>> implements Callable<T> {
	
	public CallableTask(String key, Callable<T> callable) {
		super(key, callable);
	}

	@Override
	public T call() throws Exception {
		try {
			if(getTask() != null) {
				return getTask().call();
			}
			return null;
		} finally {
			done();
		}
	}
	

}
